package com.ocom.srvpaccess.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.dto.MachInfoDto;
import com.ocom.common.entity.access.EntityMjDeviceInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface IDaoMjDeviceInfo extends BaseMapper<EntityMjDeviceInfo> {

    @Select("select device.device_id,device.device_name,device.area_id,area.area_name,area.region_id,region.region_name,device.open_type FROM " +
            "mj_device_info device INNER JOIN   mj_area_info area  " +
            "ON device.com_id=area.com_id AND  device.area_id=area.area_id AND device.device_no=#{machNo} " +
            "LEFT JOIN  mj_region_info region ON area.com_id=region.com_id and area.region_id=region.region_id " +
            " where device.com_id = #{companyId}  limit 1")
    public MachInfoDto selectmachNo(Long companyId, String machNo);
}
